package core.communication.message;

import java.util.Comparator;
import java.util.PriorityQueue;

public class MessagePriorityQueue {
	private PriorityQueue<Message> priorityQueue = new PriorityQueue<Message>(
			1, new Comparator<Message>() {
				public int compare(Message o1, Message o2) {
					return (int)o2.getPriority().ordinal() - (int)o1.getPriority().ordinal();
				}
			});
	
	public PriorityQueue<Message> getPriorityQueue() {
		return priorityQueue;
	}

	public void add(Message message) {
		priorityQueue.add(message);
	}
}
